package com.zzyy.study.config;

import dev.langchain4j.community.model.dashscope.QwenChatModel;
import dev.langchain4j.community.model.dashscope.WanxImageModel;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.service.AiServices;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @auther zzyy
 * @create 2025-02-21 22:42
 */
@Configuration(proxyBeanMethods = false)
public class ChatLanguageModelConfig
{
    @Bean
    public ChatLanguageModel chatLanguageModel()
    {
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("LANGCHAIN4J_KEY"))
                .modelName("qwen-vl-max") //图片理解
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .build();
    }

    /*@Bean
    public ChatLanguageModel chatLanguageModel2()
    {
        return QwenChatModel.builder()
                .apiKey(System.getenv("LANGCHAIN4J_KEY"))
                .modelName("wanx2.1-t2i-turbo") //图片生成
                .baseUrl("https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis")
                .build();
    }*/

    @Bean
    public WanxImageModel wanxImageModel()
    {
        return WanxImageModel.builder()
                .apiKey(System.getenv("LANGCHAIN4J_KEY"))
                .modelName("wanx2.1-t2i-turbo") //图片生成
                .build();
    }
}


